Getting Started with R
author: Tim Dennis, Data Science Center date: 2020-08-05 autosize: true
Today’s Learning Objectives
- Describe what R and RStudio are and how they are used
- Understand and use each pane in the RStudio IDE
- Locate buttons and options in the RStudio IDE
- Familiarity with running R code
- Know what packages are and how to install and load them
- Inspecting data and doing simple plots
What are R and RStudio?
At its simplest, R is like a car’s engine while RStudio is like a car’s dashboard
R & RStudio
- R is a programming language that runs computations
- RStudio is an integrated development environment (IDE) that provides an interface by adding many convenient features and tools
- RStudio Cloud provides us access to RStudio & R in the cloud via a web browser
Using R via RStudio
Much as we don’t drive a car by interacting directly with the engine but rather by interacting with elements on the car’s dashboard, we won’t be using R directly but rather we will use RStudio’s interface.
How do I code in R?
- Unlike other statistical software & mapping programs like Excel, SPSS, or QGIS that provide point-and-click interfaces, R is an interpreted language
- This means you have to type in commands written in R code.
Programming concepts and terminology
- There’s a lot of terminology in programming and R - we don’t expect you to learn all of it now
- We’ll take a learn by doing approach in this class
- We’ve created a glossary in the course on some basic ones you can reference if you get stuck.
- The primers in RStudio Cloud also give you some context to concepts and terms.
Learning to Code
The best way to master these topics is, in our opinions, through deliberate practice with R and lots of repetition.
Tips on learning to code
- Remember that computers are not actually that smart
- Take the “copy, paste, and tweak” approach
- The best way to learn to code is by doing
- Practice is key
R Packages
R packages extend the functionality of R by providing additional functions, data, and documentation. They are written by a worldwide community of R users and can be downloaded for free from the internet. They are essential features of R - we will be using packages in this class.
A good analogy for R packages is they are like apps you can download onto a mobile phone:

R Packages
- We first install packages to our machine. You can use the Packages menu on the right bottome pane.

How the class works
- I’ll be live coding in RStudio Cloud
- You’ll be following along with me, typing all the code and running it
- You have your own copy of the class notes R script and I’ll check to make sure you participating
- We also have a separate R Script called challenges that I’ll prompt you to solve inclass
- The important things is to try, we’ll go over answers together
Let’s start
Follow this link to the shared RStudio Project. It is also in your course website.